<!DOCTYPE html>
<html lang="zxx">

<head>
	<title>用户</title>
	<!-- custom-theme -->
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="keywords" content="" />
	<script type="application/x-javascript">
        addEventListener("load", function () {
            //将0改为2000 hpt update 20200903
            setTimeout(hideURLbar, 2000);
        }, false);

        function hideURLbar() {
            window.scrollTo(0, 1);
        }
    </script>
	<!-- //custom-theme -->
	<link href="css/bootstrap.css" rel="stylesheet" type="text/css" media="all" />
	<link rel="stylesheet" type="text/css" href="css/table-style.css" />
	<!-- <link rel="stylesheet" type="text/css" href="css/basictable.css" /> -->
	<link href="css/component.css" rel="stylesheet" type="text/css" media="all" />
	<!-- <link href="css/style_grid.css" rel="stylesheet" type="text/css" media="all" /> -->
	<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
	<link href="css/bootstrap-table.css" rel="stylesheet" type="text/css" media="all" />
	<!-- font-awesome-icons -->
	<link href="css/font-awesome.css" rel="stylesheet">
	<!-- //font-awesome-icons -->
	<link href="http://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i,800"
		rel="stylesheet">
</head>
<script src="Plugins/vue.js"></script>
<script type="text/javascript" src="js/jquery-2.1.4.min.js"></script>
<script>
	window.onload = function () {
		var userRole = JSON.parse(localStorage.getItem("loginUrseData")).role;
		var vm = new Vue({
			el: "#gn-menun",
			data: {
				role: userRole
			}
		})
	}
</script>
<style>
	#formSearch {
		margin-left: 30%;
		margin-top: 100px;

	}

	.form-control {
		width: 320px;
	}

	#qrcode {
		margin-top: 3%;
	}

	#downloadCode {
		margin-top: 3%;
	}
</style>

<body>
	<!-- banner -->
	<div class="wthree_agile_admin_info">
		<!-- /w3_agileits_top_nav-->
		<!-- /nav-->
		<div class="w3_agileits_top_nav">
			<ul id="gn-menu" class="gn-menu-main">
				<!-- /nav_agile_w3l -->
				<li class="gn-trigger">
					<a class="gn-icon gn-icon-menu"><i class="fa fa-bars" aria-hidden="true"></i><span>Menu</span></a>
					<nav class="gn-menu-wrapper">
						<div class="gn-scroller scrollbar1">
							<ul class="gn-menu agile_menu_drop" id="gn-menun">
								<!-- <li>
                                    <a href="main-page.html"> <i class="fa fa-tachometer"></i> Dashboard</a>
                                </li> -->
								<template v-bind: v-if="role === 1 || role === 2">
									<li>
										<a href="ACommunity.html"> <i class="fa fa-table"
												aria-hidden="true"></i>小区管理</a>
									</li>
								</template>
								<template v-bind: v-if="role === 1 || role === 2">
									<li>
										<a href="#"><i class="fa fa-cogs" aria-hidden="true"></i> 设备管理 <i
												class="fa fa-angle-down" aria-hidden="true"></i></a>
										<ul class="gn-submenu">
											<li class="mini_list_agile"><a href="ABarcode.html"><i
														class="fa fa-caret-right" aria-hidden="true"></i>
													二维码管理</a></li>
											<li class="mini_list_w3">
												<a href="ABeacon.html"> <i class="fa fa-caret-right"
														aria-hidden="true"></i> 信标管理</a>
											</li>
											<li class="mini_list_w3">
												<a href="ALift.html"> <i class="fa fa-caret-right"
														aria-hidden="true"></i> DTU管理</a>
											</li>
											<li class="mini_list_w3">
												<a href="generate_code.html"> <i class="fa fa-caret-right"
														aria-hidden="true"></i>二维码生成</a>
											</li>
										</ul>
									</li>
								</template>
								<template v-bind: v-if="role === 1 || role === 3 || role === 4">
									<li>
										<a href="#"> <i class="fa fa-file-text-o" aria-hidden="true"></i>申请权限管理 <i
												class="fa fa-angle-down" aria-hidden="true"></i></a>
										<ul class="gn-submenu">
											<li class="mini_list_agile"><a href="approve.html"><i
														class="fa fa-caret-right" aria-hidden="true"></i>已通过申请权限管理</a>
											</li>
											<li class="mini_list_w3"><a href="refuse.html"><i class="fa fa-caret-right"
														aria-hidden="true"></i>已拒绝申请权限管理</a>
											</li>
											<li class="mini_list_w3"><a href="table.html"><i class="fa fa-caret-right"
														aria-hidden="true"></i>权限申请管理</a>
											</li>
										</ul>
									</li>
								</template>
								<template v-bind: v-if="role === 1 || role === 3">
									<li>
										<a href="AUser.html"> <i class="fa fa-table" aria-hidden="true"></i>用户管理</a>
									</li>
								</template>
							</ul>
						</div>
						<!-- /gn-scroller -->
					</nav>
				</li>
				<!-- //nav_agile_w3l -->
				<li class="second logo">
					<h1><a href="manage.html"><i class="fa fa-graduation-cap" aria-hidden="true"></i>1智能呼梯管理平台</a>
					</h1>
				</li>
				<li class="second admin-pic">
					<ul class="top_dp_agile">
						<li class="dropdown profile_details_drop">
							<a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
								<div class="profile_img">
									<span class="prfil-img"><img src="images/admin.jpg" alt=""> </span>
								</div>
							</a>
							<ul class="dropdown-menu drp-mnu">
								<li><a href="login.html"><i class="fa fa-sign-out"></i> 登出</a></li>
							</ul>
						</li>

					</ul>
				</li>
				<li class="second top_bell_nav">
					<ul class="top_dp_agile ">
						<li class="dropdown head-dpdn">
							<a href="table.html" id="tongzhiId" class="dropdown-toggle" data-toggle="dropdown"
								aria-expanded="true"><i class="fa fa-bell-o" aria-hidden="true"></i> <span
									class="badge blue" id="unreadCount"></span></a>
							<ul class="dropdown-menu">
								<li>
									<div class="notification_header">
										<h3>你的通知</h3>
									</div>
								</li>
								<li>
									<a href="table.html">
										<div class="notification_desc">
											<h6>你有<span style="color: red;" id="unreadCount"></span>个申请待处理</h6>
										</div>
										<div class="clearfix"></div>
									</a>
								</li>
								<div class="notification_bottom">
									<a href="table.html">查看详情</a>
								</div>
						</li>
					</ul>
				</li>

			</ul>
			</li>
			<li></li>
			</ul>


		</div>
		<div class="clearfix"></div>
		<!-- //w3_agileits_top_nav-->

		<!-- /inner_content-->

		<div class="inner_content">

			<form id="formSearch" class="form-horizontal">
				<div id="srcData">
					<div class="form-group" style="margin-top: 15px">
						<!-- <label class="control-label col-sm-1" for="txt_search_departmentname">二维码编号</label> -->
						<div class="col-sm-3">
							<input type="text" class="form-control" v-model="code" id="txt_search_departmentname"
								placeholder="请输入数据">
						</div>
						<div class="col-sm-4" style="text-align: left;">
							<button type="button" style="margin-left: 50px" id="btn_query" class="btn btn-primary"
								@click="generateCode()">生成二维码
							</button>
						</div>
					</div>
					<div id="qrcode" class="qrcode">
					</div>
					<div id="downloadCode" style="display: none;">
						<button type="button" style="margin-left: 50px;" id="btn_query" class="btn btn-primary"
							@click="downloadClick()">下载二维码
						</button>
					</div>
				</div>
		</div>
		</form>

	</div>


	<!-- <div id="image_log" padding="100px">
            <img src="./images/home_log.jpg" width="80%" height="70%" />
        </div> -->
	<!-- 放一张北京图片 -->
	<!-- js -->
	<!-- 隐藏input为了保存拒绝的理由 -->
	<input type="hidden" name="" id="reason" value="" />
	<script type="text/javascript" src="js/jquery-2.1.4.min.js"></script>
	<script src="js/modernizr.custom.js"></script>

	<script src="js/classie.js"></script>
	<script src="js/gnmenu.js"></script>
	<script>
		new gnMenu(document.getElementById('gn-menu'));
	</script>
	<!-- tables -->

	<!-- //js -->
	<script src="js/screenfull.js"></script>
	<script src="src/jquery.qrcode.js"></script>
	<script src="src/qrcode.js"></script>
	<script>
		var my_token = JSON.parse(localStorage.getItem("loginUrseData")).token;
		var refuseIds = [];
		$(function () {
			//首先生成待处理数量
			$.ajax({
				type: "get",
				url: 'https://ytcloud2.yungtay.com.cn:1443/proServer/api/access/getPendingCount',
				contentType: 'application/json;charset=utf-8',
				headers: {
					Token: my_token //这里是Token
				},
				data: { communityId: JSON.parse(localStorage.getItem("loginUrseData")).communityId, status: 1 },
				success: function (res) {
					$("[id=unreadCount]").text(res.data.num)
					if (res.data.num == 0) {
						$("[id=tongzhiId]").hide()
					}
				},
				error: function (error) {
					alert('登陆过期,请重新登录')
					window.location.href = "login.html";
					console.log(error);
				}
			})
		});

		var vue = new Vue({
			el: "#srcData",
			data: {
				code: ""
			},
			methods: {
				generateCode: function () {
					var layer = '';
					layui.use('layer', function () {
						layer = layui.layer;
					});
					if (!vue.code) {
						layer.msg('请输入数据！');
						return
					}
					$('#qrcode').html("");
					$(".qrcode").qrcode({ width: 200, height: 200, text: vue.code });
					$('#downloadCode').show();
					console.log(downloadClickCode);
				},
				//下载二维码
				downloadClick: function () {
					var canvas = $("#qrcode").find("canvas").get(0);
					var a = document.createElement("a");
					a.href = canvas.toDataURL();
					console.log(canvas.toDataURL())
					a.download = vue.code;
					a.click();
				}
			}
		});
	</script>
	<script src="js/jquery.nicescroll.js"></script>
	<script src="js/scripts.js"></script>
	<script type="text/javascript" src="js/bootstrap-3.1.1.min.js"></script>
	<script type="text/javascript" src="js/bootstrap-table.min.js"></script>
	<script type="text/javascript" src="js/bootstrap-table-zh-CN.js"></script>
</body>
<script src="Plugins/layui/layui.js"></script>
<script src="Plugins/vue.js"></script>
<script src="js/common.js"></script>
<script type="text/javascript">

</script>

</html>